fix: batch pip installs in bootstrap for faster installs#4530
Open
Manvi2402 wants to merge 3 commits intoopen-telemetry:mainfrom
Open
fix: batch pip installs in bootstrap for faster installs#4530Manvi2402 wants to merge 3 commits intoopen-telemetry:mainfrom
Manvi2402 wants to merge 3 commits intoopen-telemetry:mainfrom
Conversation
herin049
requested changes
May 5, 2026
| ### Fixed | ||
|
|
||
| - `opentelemetry-instrumentation`: Batch all packages into a single `pip install` call in `bootstrap.py` to improve performance | ||
| ([#4484](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4484)) |
Contributor
There was a problem hiding this comment.
This needs to be updated to link to the PR
Author
There was a problem hiding this comment.
Updated the changelog to link to the PR instead of the issue. Thanks for the review.
| @@ -71,7 +71,7 @@ def _sys_pip_install(package): | |||
| "-U", | |||
There was a problem hiding this comment.
Thanks For your contribution !
Can you also add to the opentelemetry-bootstrap -a install command a flag support to disable the -U of pip install?
In a fresh environment (e.g., Docker build), there's nothing to upgrade, so the upgrade check is pure overhead
Author
There was a problem hiding this comment.
Thanks for the suggestion. Added a --no-upgrade flag to disable the -U option for fresh environments like Docker builds.
idan-rahamim-lendbuzz
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously,
_run_installinbootstrap.pycalledpip installonce perpackage in a loop, causing multiple subprocess spawns, pip loads, and
dependency resolution passes. For a typical project with ~8 instrumentors,
this took 60-120 seconds.
This change batches all packages into a single
pip installcall, reducingit to 15-25 seconds (4-6x speedup).
Fixes #4484
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
python -m py_compileDoes This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.